package com.atguigu.queue;

import org.junit.Test;

public class QueueArrayTest {

    @Test
    public void test1(){
        QueueArray<Integer>queueArray=new QueueArray<>(10);
        for (int i = 0; i < 10; i++) {
            queueArray.enqueue(i);
        }
        System.out.println(queueArray);
        for (int i = 0; i < 5; i++) {
            queueArray.enqueue(i+10);
        }
        System.out.println(queueArray);
        Integer integer = queueArray.dequeue();
        System.out.println(integer);
        System.out.println(queueArray);
        queueArray.dequeue();
        queueArray.dequeue();
        queueArray.dequeue();
        System.out.println(queueArray);
    }
    @Test
    public void test3(){
        LoopQueue<Integer>queue=new LoopQueue<>();
        for (int i = 0; i < 10; i++) {
            queue.enqueue(i);
            System.out.println(queue);
            if(i%3==2){
                queue.dequeue();
                System.out.println(queue);
            }
        }
    }
    @Test
    public void test4(){
        LinkedListQueue<Integer>queue=new LinkedListQueue<>();
        for (int i = 0; i < 20; i++) {
            queue.enqueue(i);
            System.out.println(queue);
            if(i%3==2){
                queue.dequeue();
                System.out.println(queue);
            }
        }
    }

}
